package com.kt.app.ui.components


import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kt.app.R

@Composable
fun ImageSample() {
    Image(
        painter = painterResource(id = R.drawable.beautiful1), contentDescription = null,
        modifier = Modifier
            .size(50.dp),
        contentScale = ContentScale.Crop,
        alpha = 0.5f    // 透明度
//        colorFilter = ColorFilter.tint(Color.Gray,  blendMode = BlendMode.Color) //设置滤镜
    )
}

@Preview
@Composable
fun ImageSamplePreview() {
    ImageSample()
}

